/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2022-04-16
 * Time: 10:25
 */
public class TestDemo1 {
    public static void main(String[] args) {
        String str="My friend Bill will pay the bill";
        int i=0;
      while(i<str.length()-3){
          int index=str.indexOf("ill",i);
          if(index==-1)
              System.exit(0);
          System.out.println(index);
            i=index+3;
      }

    }

}
